package com.maxmind.common.validate;

import java.io.Serializable;

import com.maxmind.common.Response;


/**
 * @Description: 响应结果处理工具类
 * <p>
 */
public class ResponseValidateUtils implements Serializable {

    /**
     * @Description: 响应结果校验，失败抛异常 <br>
     *
     * @param response
     * @return 
     */
    public static void validResponse(Response response) {
        if (null == response) {
            AlikAssert.isTrue(false, ResCode.ORDER_ERROR_1001, ResCode.ORDER_ERROR_1001_DESC);
        } else if(!CommonConstants.CODE_SUCCESS.equals(response.getCode())) {
            AlikAssert.isTrue(false, response.getCode(), String.valueOf(response.getMsg()));
        }
    }
    
}
